package na.learn.logging.sample;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

public class PropertiesManager {

	public static final String PropertiesFileLocation = ".\\config\\Logging.properties";

	public static final String LogConfigFileLocation = "LogConfigFileLocation";

	public static final String LogFileLocation = "LogFileLocation";

	public static Properties properties;

	public static void init() {
		properties = new Properties();

		try {
			properties.load(new FileInputStream(PropertiesFileLocation));
		} catch (IOException ioex) {
			ioex.printStackTrace();
		}

	}

	// Read properties file
	public static void loadProperties() {
		init();
	}

	// Write properties file
	public static void storeProperties() {
		try {
			properties
					.store(new FileOutputStream(PropertiesFileLocation), null);
		} catch (IOException e) {
		}

	}

	/*public static void main(String[] args) {
		if (properties == null)
			init();
		System.out.println(properties
				.getProperty(PropertiesManager.LogConfigFileLocation));

	}*/

}
